function userlogin(){
    var user=document.getElementById("user").value; 
    var password=document.getElementById("password").value;
    var params = "user="+user+"&password="+password;
    var url = "include/login.inc.php";
        $.ajax({
            type: 'POST',
            url: url,
            dataType: 'html',
            data: params,
            beforeSend: function() {
                document.getElementById("status").innerHTML= 'checking...';
            },
            complete: function() {
            },
            success: function(html) {
                document.getElementById("status").innerHTML= html;
                    if(html=="Erfolgreich"){
                        window.location = "index.php"
                }
            }
    });
}

function userlogout(){
    var params = "logout=true";
    var url = "include/logout.inc.php";
        $.ajax({
            type: 'POST',
            url: url,
            dataType: 'html',
            data: params,
            beforeSend: function() {
                document.getElementById("status").innerHTML= 'checking...';
            },
            complete: function() {
            },
            success: function(html) {
                document.getElementById("status").innerHTML= html;
                    if(html=="Erfolgreich"){
                        document.getElementById("status").innerHTML= 'ausgeloggt...';
                }
            }
    });
}
